// 引入createStore,专门用于创建redux核心对象store
import { createStore, applyMiddleware, combineReducers } from "redux"
// 引入服务组件Count的reducer
import countReducer from "./reducers/count"
// 引入服务组件Count的reducer
import personReducer from "./reducers/person"
// 引入异步任务需要的redux_thunk
import thunk from 'redux-thunk'

// 组装所有的reducer
const allReducer = combineReducers({
    person: personReducer,
    count: countReducer
})

// 创建 Redux store 来存放应用的状态。
export default createStore(allReducer, applyMiddleware(thunk))
